package com.netease.pris.activity.a;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.netease.image.c;
import com.netease.l.b.a;
import com.netease.pris.activity.PRISActivitySetting;
import com.netease.pris.activity.view.TextViewEx;
import com.netease.pris.activity.view.b;
import com.netease.pris.atom.g;
import com.netease.pris.atom.u;
import java.util.LinkedList;
import java.util.List;

public class af extends BaseAdapter
{
  private int a;
  private int b;
  private int c;
  private int d;
  private LinkedList e;
  private Context f;
  private LayoutInflater g;
  private b h = new l(this);

  public af(Context paramContext)
  {
    this.f = paramContext;
    this.g = ((LayoutInflater)paramContext.getSystemService("layout_inflater"));
    this.a = c.a(paramContext, 30.0F);
    this.b = this.a;
    this.c = c.a(paramContext, 66.0F);
    this.d = this.c;
  }

  private void a(ai paramai, View paramView)
  {
    try
    {
      paramai.b = 0;
      paramai.c = ((ImageView)paramView.findViewById(2131558663));
      paramai.d = ((TextView)paramView.findViewById(2131558666));
      paramai.e = ((TextView)paramView.findViewById(2131558667));
      paramai.f = ((TextView)paramView.findViewById(2131558668));
      paramai.g = ((TextViewEx)paramView.findViewById(2131558671));
      paramai.h = ((ImageView)paramView.findViewById(2131558672));
      paramai.i = ((TextView)paramView.findViewById(2131558673));
      paramai.j = ((TextView)paramView.findViewById(2131558674));
      paramai.k = paramView.findViewById(2131558423);
      return;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
    }
    finally
    {
    }
    throw localObject;
  }

  private void a(ai paramai, u paramu, int paramInt)
  {
    while (true)
    {
      try
      {
        paramai.k.setBackgroundDrawable(com.netease.framework.k.a(this.f).b(2130837725));
        String str1 = paramu.aJ();
        paramai.d.setText(str1);
        if (!paramu.aI())
          continue;
        paramai.e.setText("  " + this.f.getString(2131361912));
        String str2 = a.a(this.f, paramu);
        paramai.f.setText(str2);
        if (paramai.b <= 0)
          continue;
        com.netease.image.d.a().a(paramai.b, 1);
        paramai.b = 0;
        paramai.b = com.netease.b.a.d.f();
        paramai.c.setImageResource(2130837856);
        String str3 = paramu.aK();
        if (str3 == null)
          continue;
        StringBuilder localStringBuilder1 = new StringBuilder();
        paramai.c.setTag(localStringBuilder1);
        com.netease.image.d.a().a(localStringBuilder1, 1, str3, new j(this, paramai), this.a, this.b, 2, paramai.b);
        paramai.h.setVisibility(8);
        paramai.h.setImageDrawable(com.netease.framework.k.a(this.f).b(2130837589));
        boolean bool = PRISActivitySetting.i(this.f);
        String str4 = paramu.b(g.g);
        if ((str4 == null) || (bool))
          continue;
        paramai.h.setVisibility(0);
        StringBuilder localStringBuilder3 = new StringBuilder();
        paramai.h.setTag(localStringBuilder3);
        com.netease.image.d.a().a(localStringBuilder3, 2, str4, new k(this, paramai), this.c, this.d, 2, paramai.b);
        String str5 = paramu.X();
        if (str5 == null)
          break;
        paramai.a = paramu.u();
        if (paramai.a)
        {
          i = com.netease.framework.k.a(this.f).c(2131230907);
          if ((!paramu.aI()) || (paramu.aL() == null))
            continue;
          StringBuilder localStringBuilder2 = new StringBuilder();
          Object[] arrayOfObject = new Object[2];
          arrayOfObject[0] = Integer.valueOf(i);
          arrayOfObject[1] = paramu.aL();
          str5 = String.format("<font color='#%06x'><b>%s: </b></font>", arrayOfObject) + str5;
          paramai.i.setText(null);
          paramai.g.setVisibility(0);
          paramai.g.setText(Html.fromHtml(str5));
          paramai.g.a(this.h);
          paramai.g.setTag(paramai);
          paramai.g.setTextColor(i);
          return;
          paramai.e.setText(null);
          continue;
        }
      }
      catch (NullPointerException localNullPointerException)
      {
        localNullPointerException.printStackTrace();
      }
      finally
      {
      }
      int i = com.netease.framework.k.a(this.f).c(2131230909);
    }
    paramai.i.setVisibility(8);
    paramai.g.setVisibility(8);
    paramai.g.setText(null);
    paramai.g.a(null);
    paramai.g.setTag(null);
  }

  public u a(int paramInt)
  {
    if (this.e != null)
      if (paramInt >= this.e.size())
        paramInt = -1 + this.e.size();
    for (u localu = (u)this.e.get(paramInt); ; localu = null)
      return localu;
  }

  public void a()
  {
    synchronized (this.e)
    {
      this.e.clear();
      notifyDataSetChanged();
      return;
    }
  }

  public void a(LinkedList paramLinkedList)
  {
    this.e = paramLinkedList;
  }

  public void a(List paramList)
  {
    if ((paramList == null) || (paramList.size() == 0));
    while (true)
    {
      return;
      synchronized (this.e)
      {
        for (int i = -1 + paramList.size(); i >= 0; i--)
          this.e.addFirst(paramList.get(i));
        notifyDataSetChanged();
      }
    }
  }

  public void b(List paramList)
  {
    if ((paramList == null) || (paramList.size() == 0));
    while (true)
    {
      return;
      synchronized (this.e)
      {
        this.e.addAll(paramList);
        notifyDataSetChanged();
      }
    }
  }

  public int getCount()
  {
    int i = 0;
    if (this.e != null)
      i = this.e.size();
    return i;
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    ai localai;
    if ((paramView != null) && ((paramView.getTag() instanceof ai)))
      localai = (ai)paramView.getTag();
    while (true)
    {
      u localu = a(paramInt);
      if (localu != null)
        a(localai, localu, paramInt);
      return paramView;
      paramView = this.g.inflate(2130903111, null);
      localai = new ai(this);
      a(localai, paramView);
      paramView.setTag(localai);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.a.af
 * JD-Core Version:    0.6.0
 */